package geektime.spring.springbucks.controller;

import geektime.spring.springbucks.model.Coffee;
import geektime.spring.springbucks.model.CoffeeOrder;
import geektime.spring.springbucks.service.CoffeeOrderService;
import geektime.spring.springbucks.service.CoffeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class CoffeeOrderController {

    @Autowired
    private CoffeeOrderService orderService;

   //返回XML,固定条件取1
    @RequestMapping(value = "/queryCoffeeOrderXml",method = RequestMethod.POST,produces = MediaType.APPLICATION_XML_VALUE)
    public @ResponseBody CoffeeOrder queryCoffeeOrderXml() {
        CoffeeOrder coffeeOrder = orderService.findOneCoffeeOrder((long)1);
        return coffeeOrder;
    }


}
